/*****************************************************************************
 * vfd.h
 *
 * Copyright (C) 2020 Jeasonvor 1101627719@qq.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 ****************************************************************************/
#ifndef __VFD_H__
#define __VFD_H__

/*****************************************************************************
 * Included Files
 ****************************************************************************/

/*****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/*****************************************************************************
 * Public Types
 ****************************************************************************/

typedef enum {
    DEV_VFD_RUN_PST,  /** 正向运行 */
    DEV_VFD_RUN_NGT,  /** 反向运行 */
    DEV_VFD_RUN_STOP, /** 停止运行 */
    DEV_VFD_RUN_ERR,  /** 发生错误 */
} dev_vfd_run_t;
/*****************************************************************************
 * Public Data
 ****************************************************************************/

/****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

/**
 * @brief:  变频器运行设置
 *
 * @param[in]:  id      -   从站ID
 * @param[in]:  type    -   运行方式
 *
 * @return: 返回执行状态
 * **/
plum_s32 dev_vfd_run(plum_u8 id, dev_vfd_run_t type);

/**
 * @brief: 变频器运行状态查询
 *
 * @param[in]:  id  -   从站ID
 *
 * @return: 返回运行状态
 * **/
dev_vfd_run_t dev_vfd_run_get(plum_u8 id);

/**
 * @brief： 设置变频器运行频率
 *
 * @param[in]:  id      -   从站ID
 * @param[in]:  fre     -   频率（Hz）
 *
 * @return: 返回执行状态
 * **/
plum_s32 dev_vfd_fre(plum_u8 id, plum_u32 fre);

/**
 * @brief:  变频器运行频率查询
 *
 * @param[in]:  id  -   从站ID
 *
 * @return: 返回运行频率
 * **/
plum_u32 dev_vfd_fre_get(plum_u8 id);

/****************************************************************************/
#ifdef __cplusplus
}
#endif
/****************************************************************************/
#endif /* __VFD_H__ */
/****************************************************************************/
/*                                                                          */
/*  End of file.                                                            */
/*                                                                          */
/****************************************************************************/
